package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.SpecificationEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author chaoxiong.lei
 * @date 2019/2/14 16:15
 */
public interface SpecificationDao {

    Integer insert(SpecificationEntity specification);

    void insertBatch(@Param("list") List<SpecificationEntity> list);

    Integer update(SpecificationEntity specification);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer deleteByKeys(@Param("keys") List<Long> keys, @Param("corpid") String corpid);

    SpecificationEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<SpecificationEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer deleteByProductId(@Param("productId") Long productId, @Param("corpid") String corpid);

    Integer updateBatch(@Param("list") List<SpecificationEntity> updateList,  @Param("corpid") String corpid);
}
